package demo11;

public class Students{
    private String Name;
    private int Id;
    private String Sex;
    private int Age;
    private double Income;
    private double Wages;
    private Laboratory [] laboratories;

    public Students(int id, String name, String sex,int Age,Laboratory[] laboratories, int Income) {
        this.Id = id;
        this.Name = name;
        this.Sex = sex;
        this.Age =Age;
        this.laboratories = laboratories;
        this.Income = Income;
    }
    public Students(String name, String sex, int id,String Sex) {
        this.Name=name;
        this.Sex=sex;
        this.Id=id;
        this.Sex = sex;
    }
    public String getName() {
        return Name;
    }
    public void setName(String name) {
        Name = name;
    }
    public int getId() {
        return Id;
    }
    public void setId(int id) {
        Id = id;
    }
    public String getSex() {
        return Sex;
    }
    public void setSex(String sex) {
        Sex = sex;
    }
    public int getAge() {
        return Age;
    }
    public void setAge(int age) {
        Age = age;
    }

    public double getIncome() {
        return Income;
    }
    public int setIncome(int income) {
        this.Income += income;
        return income;
    }
    public double getWages() {
        return Wages;
    }
    public double setWages(double income) {
        this.Income -= income;
        return Income;
    }

    public Laboratory[] getlaboratory() {
        return laboratories;
    }
    public Laboratory[] setlaboratory(int s, Laboratory[] laboratories, Laboratory laboratories0) {
        this.laboratories[s] = laboratories0;
        return laboratories;
    }
    public void AchievementJudgment(String[] cleanScore, Students stud) {
        // TODO Auto-generated method stub
        try {
            for (int i = 0; i < 18; i++) {
                if (cleanScore[i]=="优秀") {
                    stud.setIncome(300);
                }
                if (cleanScore[i]=="良好") {
                    stud.setIncome(200);
                }
                if (cleanScore[i]=="及格") {
                    stud.setIncome(100);
                }
                if (cleanScore[i]=="不及格") {
                    stud.setIncome(0);
                }
                if (cleanScore[i]=="优秀"||cleanScore[i]=="良好"||cleanScore[i]=="及格"||cleanScore[i]=="不及格") {
                    continue;
                }
                System.out.println("该等级输入异常！");
                break;
            }
        } catch (Exception e) {
            System.out.println("该等级输入异常！");
        }
    }
    public void xueshengxinxi() {
        System.out.println("学生编号："+this.getId()+"    学生姓名："+this.Name+"    年龄："+this.getAge()+"    性别："+this.Sex);
    }

}
